import config from './config'
export default function (url, data = {}, method = 'GET') {
  return new Promise((resolve, reject) => {
    wx.request({
      url: config.host+url,
      data,
      method,
      header: {
        cookie:'MUSIC_U=200f728d33aa825c192e6ec11ebb811594603a07cccf5e4069bb4426ae1ecc1f9fe0240d96d3c20a6a44f6c545146509e4524b066f1931906dee108ffa25353140544341ff11443dd4dbf082a8813684; Max-Age=1296000; Expires=Thu, 29 Sep 2022 00:48:25 GMT; Path=/; Domain=.music.163.com; HTTPOnly'
      },
      success: (res)=>{
        resolve(res.data)
      },
      fail: (err) => {
        reject(err)
      }
    });
   })
 }